//
//  JCClubEventCell.m
//  SquashSpark
//
//  Created by 郭吉成 on 2017/11/28.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import "JCClubEventCell.h"
#import "JCClubEventModel.h"
#import <SDWebImage/UIImageView+WebCache.h>

@interface JCClubEventCell ()

@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *coverImageView;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end

@implementation JCClubEventCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setEventModel:(JCClubEventModel *)eventModel{
    _eventModel = eventModel;
    _contentLabel.text = eventModel.title;
    if ([eventModel.eventID isEqualToString:@"GUIDE"]) {
        _coverImageView.image = [UIImage imageNamed:@"event_guide"];
        _contentLabel.text = @"Squash Spark Club User\nGuide";
    }else{
        [_coverImageView sd_setImageWithURL:eventModel.bannerList.firstObject placeholderImage:kPlaceholdImage];
    }
    _timeLabel.text = eventModel.startTime;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
